<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/3/23
  Time: 11:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" import="java.util.Date" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>员工管理</title>
    <link href="../css/homePage.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="../css/plug-time-css/jquery-ui.css"/>
    <link rel="stylesheet" id="skin" href="../css/plug-time-css/jquery-ui-1.9.2.custom.min17.css">
    <link rel="stylesheet" type="text/css" href="../css/employeeManage.css">
    <script type="text/javascript" src="../script/jquery-3.2.1.js"></script>
    <script type="text/javascript" src="../script/jquery-ym-datePlugin-0.1.js"></script>
    <script src="../script/commonFunction.js" type="text/javascript"></script>
    <script type="text/javascript" src="../script/employeeManage.js"></script>
    <style type="text/css"></style>
    <script type="text/javascript">
        $(function () {
            $("#admin_main_div").children().hide();

            tick();

            employees();

            $("#employee_go_back").click(function () {
                window.location.href = "../admin/managePageJump";
            });

            $("#employee_leave").click(function () {
                switchoverColor(this, $("#leave_div"));
            });

            $("#employee_on_job").click(function () {
                switchoverColor(this, $("#on_job_div"));
            });

            $("#employee_all").click(function () {
                switchoverColor(this, $("#employee_all_div"));
                $("#employee_sections").hide();
                $("#employee_positions").hide();
                chooseSection();
            });

            //默认功能
            $("#demoText1").ymdateplugin();

            //显示其他月
            $("#demoText2").ymdateplugin({
                showOtherMonths: true,//显示其他月
                selectOtherMonths: true//是否可选
            });

            //换肤
            $("#skins").trigger("click");
            $("#skins").click(function () {
                $("#skins").trigger("change");
            });
            $("#skins").change(function () {
                if ($(this).val() > 0) {
                    $("#skin").attr("href", "../css/plug-time-css/jquery-ui-1.9.2.custom.min" + $(this).val() + ".css");
                } else {
                    $("#skin").attr("href", "");
                }
            });

            $("#t_section").change(function () {
                findPositions(this);
            });

            $("#detail_go_back").click(function () {
                $("#admin_main_div").children().hide();
                $("#employee_all_div").show();
            });

            $(".rp_reset").click(function () {
                $("#employee_rp").hide();
            });

            $("#transfer_reset").click(function () {
                $("#employee_transfer").hide();
            });

            $("#a_go_back").click(function () {
                $("#employee_attendance").hide();
                $("#employee_all_div").show();
            });
        });
    </script>

</head>
<body id="main_body">
<div id="welcome">
    <c:if test="${manager != null}">
        欢迎${manager.name }登录&nbsp;&nbsp;&nbsp;<a href="../logout.action">退出</a>
    </c:if>
    <c:if test="${manager == null }">
        <%response.sendRedirect("../admin/login.jsp");%>
    </c:if>
    <span id="showTime">本地时间：<span id="localtime"></span></span>
</div>
<div id="admin_menu_div">
    <ul id="admin_menu_div_ul">
        <h4>
            <li id="employee_all">查看</li>
        </h4>
        <h4>
            <li id="employee_go_back">返回</li>
        </h4>
        <h4>
            <li id="quit">退出</li>
        </h4>
    </ul>
</div>
<div id="admin_main_div">

    <div id="employee_all_div">
        <select id="employee_status" onchange="chooseSection()">
            <option value="1">在职</option>
            <option value="-1">离职</option>
        </select>
        <select id="employee_sections" onchange="choosePosition()">
            <option value="">部门</option>
            <c:forEach items="${sections}" var="se">
                <option value="${se.id}">${se.section}</option>
            </c:forEach>
        </select>
        <select id="employee_positions" onchange="employees()">
            <option value="">职位</option>
        </select>
        <table cellpadding="0" cellspacing="0" border="1px" id="myTable2" class="employee_table">
            <thead>
            <tr>
                <th colspan="5">员工信息</th>
            </tr>
            <tr>
                <th>编号</th>
                <th>姓名</th>
                <th colspan="3">操作</th>
            </tr>
            </thead>
            <tbody id="employee_tb"></tbody>
        </table>
    </div>

    <div id="employee_details">
        <table cellspacing="1" cellpadding="1" border="solid 1px #000" id="resume_table0">
            <thead>
            <tr>
                <th colspan="4"><p>员工信息</p></th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>姓名：</td>
                <td id="detail_name"></td>
                <td>性别：</td>
                <td id="detail_sex"></td>
            </tr>
            <tr>
                <td>年龄：</td>
                <td id="detail_age"></td>
                <td>学历：</td>
                <td id="detail_education"></td>
            </tr>
            <tr>
                <td>联系方式：</td>
                <td id="detail_phone"></td>
                <td>e-mail：</td>
                <td id="detail_email"></td>
            </tr>
            <tr>
                <td>入职时间：</td>
                <td id="detail_entry_date"></td>
                <td>职位：</td>
                <td id="detail_position"></td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="4" style="text-align: center;">
                    <input type="hidden" id="detail_resume_id">
                    <input type="button" class="resume_bu" id="detail_reward" value="赏" onclick="clickReward()">
                    <input type="button" class="resume_bu" id="detail_punishment" value="罚" onclick="clickPunishment()">
                    <input type="button" class="resume_bu" id="detail_go_back" value="返回">
                </td>
            </tr>
            </tfoot>
        </table>
    </div>

    <div id="employee_rp">
        <span>更换日历皮肤:</span>
        <select id="skins">
            <option value="0">无皮肤</option>
            <option value="1">高亮</option>
            <option value="2">黑暗</option>
            <option value="3">平滑</option>
            <option value="4">开始</option>
            <option value="5">微软</option>
            <option value="6">阳光</option>
            <option value="7">阴天</option>
            <option value="8">青蛙</option>
            <option value="9">轻盈</option>
            <option value="10">蜂箱</option>
            <option value="11">胡椒</option>
            <option value="12">茄子</option>
            <option value="13">库比蒂诺</option>
            <option value="14">南街</option>
            <option value="15">闪击</option>
            <option value="16">人类</option>
            <option value="17">hot sneaks</option>
            <option value="18">excite-bike</option>
            <option value="19">vader</option>
            <option value="20">dot-luv</option>
        </select>
        <table cellspacing="0" cellpadding="0" border="1px"
               style="width: 299px; background-color: rgba(0,130,230,0.6)" id="r_table">
            <thead>
            <tr>
                <th colspan="2">新增奖励</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td><label for="r_cause">奖赏原因：</label></td>
                <td><input type="text" id="r_cause" name="cause" placeholder="请输入奖赏原因"/></td>
            </tr>
            <tr>
                <td><label for="demoText1">时间：</label></td>
                <td><input type="text" name="date" id="demoText1" readonly="readonly" placeholder="请选择时间"/>
                </td>
            </tr>
            <tr>
                <td><label for="r_money">奖金：</label></td>
                <td>
                    <select name="money" id="r_money">
                        <option value="50">50</option>
                        <option value="100">100</option>
                        <option value="200">200</option>
                        <option value="500">500</option>
                        <option value="800">800</option>
                        <option value="1000">1000</option>
                        <option value="1500">1500</option>
                        <option value="2000">2000</option>
                    </select>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr style="text-align: center">
                <td colspan="2">
                    <input type="hidden" id="r_resume_id" name="rId">
                    <input type="hidden" value="1" name="r_or_p">
                    <input type="reset" value="取消" class="rp_reset" id="r_reset">
                    <input type="button" value="确认" class="rp_sub" id="r_sub" onclick="rpSubmit($('#r_table'))">
                </td>
            </tr>
            </tfoot>
        </table>

        <table cellspacing="0" cellpadding="0" border="1px"
               style="width: 299px; background-color: rgba(0,130,230,0.6)" id="p_table">
            <thead>
            <tr>
                <th colspan="2">新增处罚</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td><label for="p_cause">处罚原因：</label></td>
                <td><input type="text" id="p_cause" name="cause" placeholder="请输入处罚原因"/></td>
            </tr>
            <tr>
                <td><label for="demoText2">时间：</label></td>
                <td><input type="text" name="date" id="demoText2" readonly="readonly" placeholder="请选择培训开始时间"/>
                </td>
            </tr>

            <tr>
                <td><label for="p_money">罚金：</label></td>
                <td>
                    <select name="money" id="p_money">
                        <option value="-50">-50</option>
                        <option value="-100">-100</option>
                        <option value="-200">-200</option>
                        <option value="-500">-500</option>
                        <option value="-800">-800</option>
                        <option value="-1000">-1000</option>
                        <option value="-1500">-1500</option>
                        <option value="-2000">-2000</option>
                    </select>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr style="text-align: center">
                <td colspan="2">
                    <input type="hidden" id="p_resume_id" name="rId">
                    <input type="hidden" value="-1" name="r_or_p">
                    <input type="reset" value="取消" class="rp_reset" id="p_reset">
                    <input type="submit" value="确认" class="rp_sub" id="p_sub" onclick="rpSubmit($('#p_table'))">
                </td>
            </tr>
            </tfoot>
        </table>
    </div>

    <div id="employee_transfer">
        <table cellpadding="0" cellspacing="0" border="1" id="t_table"
               style="width: 366px; margin: 22px auto;background-color: rgba(0,130,230,0.6)">
            <thead>
            <tr>
                <th colspan="3">请选择调动的部门职位：</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>
                    <select id="t_section">
                        <option value="">请选择部门</option>
                        <c:forEach items="${sections}" var="se">
                            <option value="${se.id}">${se.section}</option>
                        </c:forEach>
                    </select>
                </td>
                <td>
                    <select id="t_position">
                        <option value="">请选择职位</option>
                    </select>
                </td>
                <td>
                    <input type="hidden" name="userId">
                    <input type="reset" id="transfer_reset" value="取消">
                    <input type="button" id="transfer_sub" value="确认调动" onclick="transferSubmit(this)">
                </td>
            </tr>
            </tbody>
        </table>
    </div>

    <div id="employee_attendance">
        <select id="year"></select>
        <select id="month"></select>
        <select id="day">
            <option value="">日期</option>
        </select>
        <input type="button" value="查询" onclick="findAttendance(this)">
        <span>该月目前出勤<span id="on_job_days"></span> 天</span>
        <table cellspacing="0" cellpadding="0" border="1" id="a_table"
               style="margin: 1px auto;background-color: rgba(0,130,230,0.6)">
            <thead>
            <tr>
                <th style="width: 66px">员工</th>
                <th style="width: 180px">上班时间</th>
                <th style="width: 180px">下班时间</th>
                <th style="width: 100px">迟到</th>
                <th style="width: 100px">早退</th>
                <th style="width: 100px">加班</th>
            </tr>
            </thead>
            <tbody>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="6" style="text-align: center;">
                    <input type="hidden" name="userId">
                    <input type="button" id="a_go_back" value="返回">
                </td>
            </tr>
            </tfoot>
        </table>
    </div>

</div>

</body>
</html>
